<#include "/tags/userAvatar.ftl">

<#if (data.searchType == 1)>
<div class="searchResultList">
	<#if data.resultOfFriendSearch??>
	<#assign mgR0=""/>
	<#list data.resultOfFriendSearch as friend>
	<#if (friend_index % 2 != 0)>
		<#assign mgR0="mgR0"/>
	<#else>
		<#assign mgR0=""/>
	</#if>
	<div class="hintFriend ${mgR0}">
        <div class="avatar"><a href="${rc.contextPath}/${friend.username}">
        	<@userAvatar username=friend.username avatar=friend.avatar linkClass="" imgWidth="50" imgHeight="50"/>
        </div>
        <div class="infofriend">
            <a href="${rc.contextPath}/${friend.username}" class="friendname">${friend.username}</a>
            <#if (friend.countMutualFriends > 0)>
            <div class="text">Có chung ${friend.countMutualFriends} bạn bè</div>
            <#else>
            <div class="text">Không có bạn chung</div>
            </#if>
            <#if (friend.friend == false)>
            <a id="search_friend_result_${friend.id}" class="followFriend" href="javascript:followHintFriend(${friend.id},'#search_friend_result_${friend.id}');">KẾT BẠN</a>
            </#if>
        </div>
	</div>
	</#list>
	<#else>
		<p></p>
	</#if>	
</div>
<#if (data.hasNextPage == true)>
<div class="wallReadmore" id="next_page">
	<a href="javascript:search('${data.keyword}', ${data.searchType}, ${data.nextPage}, '#next_page');">Hiển thị thêm kết quả</a>
</div>
</#if>             
</#if>